﻿@model EquipmentPrintExternalModel
@{
    ViewBag.Title = "打印信息登记表";
}
@section BodyNav
{
    > @Html.ActionLink("备案设备列表", "List", "Equipment") > 设备备案
}
@section Js
{
    <script src="@Url.Content("~/Scripts/LodopFuncs.js")" type="text/javascript"></script>
    <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0"
        height="0">
        <param name="Border" value="0">
        <embed id="LODOP_EM" type="application/x-print-lodop" width="0" height="0"></embed>
    </object>
    <script type="text/javascript">
        var LODOP; //声明为全局变量 
        function prn1_preview() {
            LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM'));
            LODOP.SET_PRINTER_INDEX(@Model.PrinterId);
            LODOP.SET_PRINT_PAGESIZE(1,'17.6cm','25.5cm','beian');
            LODOP.SET_PRINT_MODE("POS_BASEON_PAPER",1);
            LODOP.SET_PRINT_MODE('AUTO_CLOSE_PREWINDOW',1);
            LODOP.SET_PRINT_STYLE('FontSize',11);
            CreateOneFormPage();
            //LODOP.PRINT_DESIGN();
            LODOP.PREVIEW();
            if (confirm("是否已打印完毕？")) {
                $.post("/Equipment/PrintSuccess", { 'id': @Model.Id }, function (result) {
                    if (result == "true")
                        alert('操作成功');
                    else
                        alert("操作失败");
                });
            }

            
        };
        function CreateOneFormPage() {
            $('div.print, span.print').each(function()
            {
                LODOP.ADD_PRINT_TEXT(parseInt($(this).attr('top')),$(this).attr('left'),$(this).attr('width'),$(this).attr('height'),$(this).html());
            });
        };
    </script>
}
<h2>
    打印《起重设备自然情况表》</h2>
<table class="detail">
    <tr>
        <th rowspan="2" width="120">
            @Html.LabelFor(m => m.Eq_Owner)
        </th>
        <td rowspan="2">
            <div class="print" top="100" left="190" width="172" height="97">@Html.DisplayFor(m => m.Eq_Owner)</div>
        </td>
        <th width="120">
            @Html.LabelFor(m => m.Eq_OwnerInCharge)
        </th>
        <td>
            <div class="print" top="100" left="490" width="147" height="44">@Html.DisplayFor(m => m.Eq_OwnerInCharge)</div>
        </td>
    </tr>
    <tr>
        <th>
            @Html.LabelFor(m => m.Eq_OwnerPhone)
        </th>
        <td>
            <div class="print" top="152" left="490" width="147" height="50">@Html.DisplayFor(m => m.Eq_OwnerPhone)</div>
        </td>
    </tr>
    <tr>
        <th>
            @Html.LabelFor(m => m.Eq_Producer)
        </th>
        <td>
            <div class="print" top="206" left="190" width="172" height="50">@Html.DisplayFor(m => m.Eq_Producer)</div>
        </td>
        <th>
            @Html.LabelFor(m => m.Eq_DesignCompany)
        </th>
        <td>
            <div class="print" top="206" left="490" width="147" height="50">@Html.DisplayFor(m => m.Eq_DesignCompany)</div>
        </td>
    </tr>
    <tr>
        <th rowspan="2">
            @Html.LabelFor(m => m.AJZName)
        </th>
        <td rowspan="2">
            <div class="print" top="264" left="190" width="172" height="100">@Html.DisplayFor(m => m.AJZName)</div>
        </td>
        <th>
            @Html.LabelFor(m => m.AJZAddress)
        </th>
        <td>
            @Html.DisplayFor(m => m.AJZAddress)
        </td>
    </tr>
    <tr>
        <th>
            @Html.LabelFor(m => m.AJZTel)
        </th>
        <td>
            <div class="print" top="310" left="490" width="147" height="50">@Html.DisplayFor(m => m.AJZTel)</div>
        </td>
    </tr>
</table>
<table class="detail">
    <tr>
        <th width="120">
            @Html.LabelFor(m => m.Name)
        </th>
        <td>
            <div class="print" top="445" left="254" width="267" height="50">@Html.DisplayFor(m => m.Name)</div>
        </td>
    </tr>
    <tr>
        <th>
            @Html.LabelFor(m => m.Eq_NO)
        </th>
        <td>
            <div class="print" top="485" left="254" width="267" height="50">@Html.DisplayFor(m => m.Eq_NO)</div>
        </td>
    </tr>
</table>
<table class="detail">
    <tr>
        <th width="120">
            @Html.LabelFor(m => m.Eq_Type)
        </th>
        <th>
            @Html.LabelFor(m => m.Eq_CertNo)
        </th>
        <th>
            @Html.LabelFor(m => m.Eq_MadeDate)
        </th>
        <th>
            @Html.LabelFor(m => m.Eq_MadeNo)
        </th>
    </tr>
    <tr>
        <td>
            <div class="print" top="598" left="53" width="112" height="47">@Html.DisplayFor(m => m.Eq_Type)</div>
        </td>
        <td>
            <div class="print" top="598" left="199" width="112" height="47">@Html.DisplayFor(m => m.Eq_CertNo)</div>
        </td>
        <td>
            <div class="print" top="598" left="352" width="120" height="47">@Html.DisplayFor(m => m.MadeDateString)</div>
        </td>
        <td>
            <div class="print" top="598" left="510" width="112" height="47">@Html.DisplayFor(m => m.Eq_MadeNo)</div>
        </td>
    </tr>
</table>
<table class="detail">
    <tr>
        <th>
            发证机关 <span class="print" top="788" left="180" width="360" height="50">@Html.DisplayFor(m => m.AJZName)</span>
        </th>
    </tr>
    <tr>
        <td>
            @Html.LabelFor(m => m.RegisterDate)： <span class="print" top="873" left="420" width="47"
                height="50">@Html.DisplayFor(m => m.RegisterDate.Year)</span> 年 <span class="print"
                    top="873" left="490" width="47" height="50">@Html.DisplayTextFor(m => m.RegisterDate.Month)</span>
            月 <span class="print" top="873" left="554" width="47" height="50">@Html.DisplayTextFor(m => m.RegisterDate.Day)</span>
            日
        </td>
    </tr>
    <tr>
        <td>
            <a href="javascript:prn1_preview();" class="lnkBtn">打印</a>
            @Html.ActionLink("返回列表", "List", "Equipment", null, new { @class = "lnkBtn" })
        </td>
    </tr>
</table>
